package org.dromara.system.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;

/**
 * 基础字段
 * @author zkh
 * date 2024/4/25
 */
@Data
public class BaseCommons {

    /**
     * 租户id
     */
    @TableField(value = "tenant_id",fill = FieldFill.INSERT)
    private String tenantId;

    /**
     * 部门id
     */
    @TableField(value = "dept_id",fill = FieldFill.INSERT)
    private Long deptId;

    /**
     * 删除标志（0代表存在 1代表删除）
     */
    @TableField(value = "del_flag",fill = FieldFill.INSERT,select = false)
    @TableLogic
    private String delFlag;
    /**
     * 创建人
     */
    @TableField(value = "create_by",fill = FieldFill.INSERT)
    private String createBy;
    /**
     * 创建时间
     */
    @TableField(value = "create_time",fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    /**
     * 更新人
     */
    @TableField(value = "update_by",fill = FieldFill.UPDATE,select = false)
    private String updateBy;
    /**
     * 更新时间
     */
    @TableField(value = "update_time",fill = FieldFill.UPDATE,select = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;


}
